package com.example.baseview_016;

import javax.crypto.spec.IvParameterSpec;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.ImageView;

public class ImageActivity extends Activity {
	private int[] pics = new int[]{
			R.drawable.a1,
			R.drawable.a2
	};
	private int count =0;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_image);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
    
    public void changePic(View view){
    	count++;
    	if(count>=2)
    		count = 0;
    	ImageView imageView = (ImageView) view;
    	imageView.setImageResource(pics[count]);
    }
    
}
